<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<?php


			function send_post($url, $post_data) {  
  
  				$postdata = http_build_query($post_data);  
  				$options = array(  
    				'http' => array(  
      				'method' => 'POST',  
      				'header' => 'Content-type:application/x-www-form-urlencoded',  
      				'content' => $postdata,  
      				'timeout' => 15 * 60 // 超时时间（单位:s）  
    					)  
  					);  
  				$context = stream_context_create($options);  
 				$result = file_get_contents($url, false, $context);  
  
  				return $result;  
				}  
				$username=$_POST['username'];
				$password=$_POST['password'];
				//获取用户登录数据
				
                $link=mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
                if($link)
                {
                    mysql_select_db(SAE_MYSQL_DB,$link);
                    //your code goes here	
                }
				$sql ='SELECT count(*) FROM login where username='.'"'.$username.'"'." and password=".'"'.$password.'"';
				 $result = mysql_query($sql)
                        or die(SQL语句执行失败);
				$row =mysql_fetch_row($result);
				if($row[0]=="1"){
					$post_data = array(  
 					 'login' => true,   
					);  
					send_post('http://yiyejinling.sinapp.com/all/manage.php', $post_data);  
					
					echo "登录成功，即将跳转...";
					echo '<script language="javascript">
							var hr = "http://yiyejinling.sinaapp.com/all/manage.php";
							setTimeout("window.location = hr",1000);
							
							
						</script>';
				}
				else{
					echo "登录失败，请检查您的用户名和密码,将返回主页...";
					echo '<script language="javascript">
					var hr = "http://yiyejinling.sinaapp.com/all/index.html";
					setTimeout("window.location = hr",1000);
						</script>';
				}
	?>
    <br />
<body>
</body>
</html>